import request from '@/router/axios';

//项目立项信息
//列表
export const getProjectList = (current, size, params) => {
  return request({
    url: '/api/hg-public/projectinfo/page',
    method: 'get',
    params: {
      current,
      size,
      ...params
    }
  })
}
//新增项目
export const addProject = (row) => {
  return request({
    url: '/api/hg-public/projectinfo/save',
    method: 'post',
    data: row
  })
}

//删除项目
export const removeProject = (ids) => {
  return request({
    url: '/api/hg-public/projectinfo/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新项目
export const updateProject = (row) => {
  return request({
    url: '/api/hg-public/projectinfo/update',
    method: 'post',
    data: row
  })
}

//获取详情
export const getProject = (id) => {
  return request({
    url: '/api/hg-public/projectinfo/detail',
    method: 'get',
    params: {
      id,
    }
  })
}

//获取潜在项目下拉选
export const getPotentialProjectList = () => {
  return request({
    url: '/api/hg-public/projectinfo/getPotentialProject',
    method: 'get',
    params: {
    }
  })
}
//获取客户下拉选
export const getCustomerList = () => {
  return request({
    url: '/api/hg-public/projectinfo/getCustomerList',
    method: 'get',
    params: {
    }
  })
}
//获取项目负责人下拉选
export const getPersonnelList = () => {
  return request({
    url: '/api/hg-public/projectinfo/getPersonnelList',
    method: 'get',
    params: {
    }
  })
}

//客户产品需求 
//客户产品需求列表
export const getDemandList = (params) => {
  return request({
    url: '/api/hg-public/custprddemandinfo/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//获取客户产品和内部产品对应关系详情
export const getDemand = (params) => {
  return request({
    url: '/api/hg-public/productdrawingchange/detail',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//更新客户产品和内部产品对应关系
export const updateDemand = (row) => {
  return request({
    url: '/api/hg-public/productdrawingchange/update',
    method: 'post',
    data: row
  })
}
//获取客户产品需求重要时间节点
export const getDemandTimenodes = (id) => {
  return request({
    url: '/api/hg-public/custprddemandinfo/timenodes',
    method: 'get',
    params: {
      id,
    }
  })
}
//获取客户产品需求客户产品要求列表
export const getDemandRequire = (id) => {
  return request({
    url: '/api/hg-public/custprddemandinfo/requirements',
    method: 'get',
    params: {
      id,
    }
  })
}



//项目开发任务书
//项目开发任务书列表
export const getProjectbookList = (params) => {
  return request({
    url: '/api/hg-public/prjdevtaskbook/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}

//获取项目开发任务书详情
export const getProjectbook = (id) => {
  return request({
    url: '/api/hg-public/protaskbook/detail',
    method: 'get',
    params: {
      id,
    }
  })
}

//客户联系人 
// 列表
export const getCustomerContList = (params) => {
  return request({
    url: '/api/hg-public/potentiallinkman/getByCustomerId',
    method: 'get',
    params: {
      ...params,
    }
  })
}

//项目组成员 
//项目组成员列表
export const getMemberList = (params) => {
  return request({
    url: '/api/hg-public/projectmember/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}

// 根据姓名模糊搜索人员列表
export const searchMemberList = (params) => {
  return request({
    url: '/api/blade-system/personnelinfo/getPersonsByName',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//项目组织信息
export const getOrganizationList = (current, size, params) => {
  return request({
    url: '/api/hg-public/projectmember/prjorgpage',
    method: 'get',
    params: {
      current, size,
      ...params,
    }
  })
}
//新增项目组成员
export const addMember = (row) => {
  return request({
    url: '/api/hg-public/projectmember/save',
    method: 'post',
    data: row
  })
}

//删除项目组成员
export const removeMember = (ids) => {
  return request({
    url: '/api/hg-public/projectmember/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新项目组成员
export const updateMember = (row) => {
  return request({
    url: '/api/hg-public/projectmember/update',
    method: 'post',
    data: row
  })
}

//获取项目组成员详情
export const getMember = (id) => {
  return request({
    url: '/api/hg-public/projectmember/detail',
    method: 'get',
    params: {
      id,
    }
  })
}

//获取项目组成员项目组任务
export const getTeamTask = (params) => {
  return request({
    url: '/api/hg-public/projectmember/membertasklist',
    method: 'get',
    params: {
      ...params,
    }
  })
}

// 项目组成员提交审批
export const projectMemberSubmit = (memberId) => {
  return request({
    url: '/api/hg-public/projectmember/start-process',
    method: 'get',
    params: {
      memberId,
    }
  })
}
//工装模具需求 
//工装模具需求 列表
export const getToolingList = (params) => {
  return request({
    url: '/api/hg-public/toolingmould/findAll',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增工装模具需求 
export const addTooling = (row) => {
  return request({
    url: '/api/hg-public/toolingmould/save',
    method: 'post',
    data: row
  })
}

//删除工装模具需求 
export const removeTooling = (params) => {
  return request({
    url: '/api/hg-public/toolingmould/remove',
    method: 'post',
    params: {
      ...params,
    }
  })
}

//更新工装模具需求 
export const updateTooling = (row) => {
  return request({
    url: '/api/hg-public/toolingmould/update',
    method: 'post',
    data: row
  })
}

//获取工装模具需求 详情
export const getTooling = (params) => {
  return request({
    url: '/api/hg-public/toolingmould/detail',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//工装模具需求 提交审批
export const projectToolingSubmit = (toolingMouldId) => {
  return request({
    url: '/api/hg-public/toolingmould/start-process',
    method: 'get',
    params: {
      toolingMouldId,
    }
  })
}

//产品制造评估表 
//产品制造评估表 列表
export const getEvaluationList = (params) => {
  return request({
    url: '/api/hg-public/manufacturingevaluation/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增产品制造评估表
export const addEvaluation = (row) => {
  return request({
    url: '/api/hg-public/manufacturingevaluation/save',
    method: 'post',
    data: row
  })
}

//删除产品制造评估表
export const removeEvaluation = (ids) => {
  return request({
    url: '/api/hg-public/manufacturingevaluation/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新产品制造评估表
export const updateEvaluation = (row) => {
  return request({
    url: '/api/hg-public/manufacturingevaluation/update',
    method: 'post',
    data: row
  })
}

//获取产品制造评估表 详情
export const getEvaluation = (id) => {
  return request({
    url: '/api/hg-public/manufacturingevaluation/detail',
    method: 'get',
    params: {
      id,
    }
  })
}

//产品制造评估表 提交审批
export const projectEvaluationSubmit = (id) => {
  return request({
    url: '/api/hg-public/manufacturingevaluation/start-process',
    method: 'get',
    params: {
      id,
    }
  })
}

